const { DataTypes } = require('sequelize')
const sequelize = require('../config/database')

const CollectionModel = sequelize.define('Collection', {
  collection_id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    allowNull: false,
    autoIncrement: true
  },
  user_id: {
    type: DataTypes.INTEGER,
    allowNull: false
  },
  association_id: {
    type: DataTypes.INTEGER,
    allowNull: false
  },
  type: {
    type: DataTypes.ENUM('scenery', 'hotel', 'restaurant', 'post'),
    allowNull: false
  },
  createdAt: {
    type: DataTypes.TIME
  },
  updatedAt: {
    type: DataTypes.TIME,
  }
}, {
  freezeTableName: true,
  tableName: 'collection',
  timestamps: false
})

module.exports = CollectionModel